package yy.soft.web;

import org.joda.time.DateTime;

public class WebHelper {
    private static final Object SyncObject = new Object();

    private static long ID = -1;

    public static long GetUniqueID()  {
        long num;
        DateTime time;
        synchronized (SyncObject)
        {
            do
            {
                try {
                    Thread.sleep(10L);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                time = new DateTime(0x7d6, 11, 1, 0, 0, 0, 0);
                num = DateTime.now().toDate().getTime()-time.toDate().getTime();
            }
            while (num == ID);

            ID = num;

        }
        return Math.abs(num);
    }
}